export interface User {
  id?: number;
  phone?: number;
  password?: string;
  name?: string;
  avatar?: string;
  desc?: string;
  create_time?: number;
  last_login_time?: number;
  create_ip?: string;
  last_login_ip?: string;
  create_where_from?: object;
  push_id?: string;
  status?: string;
  /**
   * @deprecated 无用
   */
  imtoken?: string;
  /**
   * @deprecated 无用
   */
  app_imtoken?: string;
  uid?: number;
  wxapp_openid?: string;
  weixin_openid?: object;
  weixin_unionid?: string;
  app_push_id?: string;
  app_os?: number;
  app_version?: number;
  // methods
  roles?: UserRole[];
}

export interface UserRole {
  id?: number;
  user_id?: number;
  team_id?: number;
  type?: 'user' | 'admin';
  create_time?: number;
  update_time?: number;

  // 扩展
  role_name?: string; // 角色名称
  team_name?: string;
  team_avatar?: string;
}

export interface UserTicket {
  /**
   * 客户端类型
   */
  client?: string;
  user_id: number;
  token: string;
  /**
   * 暂时没用上
   */
  role_id?: number;
  role_type?: string;
  shop_id?: number;
  /**
   * 过期时间
   */
  deadline?: number;
  create_time?: number;
}

export interface AddUserData {
  name: string;
  phone: string;
  password: string;
  /**
   * 用途不明 默认为0
   */
  status?: number;
}
